package com.hc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class IndexController {
    @RequestMapping("/toLogin")
    public String toLogin() {
        System.out.println("to---login");
        return "login";
    }

    @RequestMapping("/toIndex")
    public String index() {
        System.out.println("to-----index");
        return "index";
    }

    @RequestMapping("/toError")
    public String error(Model model) {
        model.addAttribute("msg", true);
        return "login";
    }
}
